<?php

namespace app\admin\model;

use think\model\Relation;

class Member extends Relation {

        protected $link = [
            'department' => [
                'mapping_type' => BELONGS_TO,
                'class_name' => 'Department',
                'foreign_key' => 'dept_id',
                'mapping_fields' => 'name as departname',
                'as_fields' => 'departname',
                'parent_key' => 'id'
            ],
            'role' => [
                'mapping_type' => BELONGS_TO,
                'class_name' => 'AuthGroup',
                'foreign_key' => 'role_id',
                'mapping_fields' => 'title as role',
                'as_fields' => 'role',
                'parent_key' => 'id'
            ]
        ];

}
